package com.ymatou.iapi.productmanager.service;

import java.util.Map;

import org.json.JSONObject;

import com.ymttest.business.YmatouAutoTestCall;
import com.ymttest.utils.EnvSetup;
import com.ymttest.utils.MapUtil;
import com.ymttest.utils.compare.CallAPI;

public class GetProductCatalogInfosCall extends YmatouAutoTestCall implements CallAPI{
	protected static String opurl ="/api/SellerProduct/GetProductCatalogInfos";
	
	public GetProductCatalogInfosCall() {
		super(EnvSetup.getSystemUrl("productmanager"),opurl,"POST","JSON");
	}
	
	public GetProductCatalogInfosCall(String systemUrl) {
		super(systemUrl,opurl,"POST","JSON");
	}
	
	@Override
	public void addDefHeader() {
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	
	public JSONObject call(int sellerId,String productId){
		return this.callAndGetReturnData(MapUtil.hashMap("UserId", sellerId,"productId",productId));
	}
	
	
	
	public static void main(String args[]){
		new GetProductCatalogInfosCall().callAndGetReturnData();
	}
	
	
	@Override
	public JSONObject callAndReturn(Map<String, Object> paramMap) {
		return this.call(Integer.parseInt(paramMap.get("userId").toString()), paramMap.get("productId").toString());
	}
	@Override
	public String getApiName() {
		return "GetProductCatalogInfos";
	}
}